import * as echarts from 'echarts';
import { styleType } from 'element-plus/es/components/table-v2/src/common';
type EChartsOption = echarts.EChartsOption;
data:Array<number>

export const zxt=(chartDom:any,arr:any)=>{
    var chartDom = chartDom!;
    var myChart = echarts.init(chartDom);
    var option: EChartsOption;
    option = {
      color:['#4fe85e','#ff0000'],
      grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
      },
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: ['周一', '周二', '周三', '周四', '周五', '周六', '周天']
        },
        yAxis: {
          type: 'value',
          
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              backgroundColor: '#6a7985'
            }
          }
        },
        legend: {
          data: [arr[0].title,arr[1].title]
        },
        series: [
          {
            name:arr[0].title,
            data:arr[0].data,
            type: 'line',
            areaStyle: {
              opacity:0.5
            },
  
          },
          {
            name:arr[1].title,
            data:arr[1].data,
            type: 'line',
            areaStyle: {
              opacity:0.5
            },
          }
        ]
      };
      
      option && myChart.setOption(option);
}








